package com.ffcc.fitness.card.mapper;

import com.ffcc.fitness.card.pojo.entity.Card;
import com.ffcc.fitness.card.pojo.vo.CardVO;
import com.ffcc.fitness.card.pojo.vo.CommentVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CardMapper {
    List<CardVO> selectAllCards();
      /**
     * 根据教练ID查询该教练发布的器械卡片
     * @param coachId 教练ID
     * @return 器械卡片列表
     */
    List<CardVO> selectCardsByCoachId(@Param("coachId") Long coachId);Long getLikeCount(@Param("targetId") Long targetId);

    Long getCommentCount(@Param("targetId") Long targetId);

    List<CommentVO> getComments(@Param("targetId") Long targetId);

    void insert(Card card);
    
    /**
     * 更新器械卡片
     * @param card 器械卡片信息
     * @return 影响的行数
     */
    int update(Card card);
    
    /**
     * 删除器械卡片
     * @param cardId 卡片ID
     */
    int delete(@Param("cardId") Long cardId);
}
